function isAllAnswered(fm) {
	var chked
	var allChked = true
	for (i = 1; i <= 28; i++) {
		chked = false
		for (j = 0; j < eval(fm.name + ".ques" + i + ".length"); j++) {
			if (eval(fm.name + ".ques" + i + "[j].checked==true")) {
				chked = true
				break;
			}
		}
		if (chked == false) {
			allChked = false
			return false
		}
	}
	return true
}

function goanstr() {
	var v = 0;
	var r = new Array();

	for (j = 0; j < 4; j++) {
		for (i = 1; i < 8; i++) {
			if (eval("test.ques" + (j * 7 + i) + "[0].checked"))
				v++;
		}
		if (v >= 4)
			r[j] = true;
		else
			r[j] = false;
		v = 0;
	}

	var max = r[0] * 1 + r[1] * 2 + r[2] * 4 + r[3] * 8;
	var sURL = ""
	var sMaxAnswer = "";
	switch (max) {
	case 0:
		sMaxAnswer = "ISTP";
		break;
	case 1:
		sMaxAnswer = "ESTP";
		break;
	case 2:
		sMaxAnswer = "ENFJ";
		break;
	case 3:
		sMaxAnswer = "ENTP";
		break;
	case 4:
		sMaxAnswer = "ISFP";
		break;
	case 5:
		sMaxAnswer = "ESFP";
		break;
	case 6:
		sMaxAnswer = "INFP";
		break;
	case 7:
		sMaxAnswer = "ENFP";
		break;
	case 8:
		sMaxAnswer = "ISTJ";
		break;
	case 9:
		sMaxAnswer = "ESTJ";
		break;
	case 10:
		sMaxAnswer = "INTJ";
		break;
	case 11:
		sMaxAnswer = "ENTJ";
		break;
	case 12:
		sMaxAnswer = "ISFJ";
		break;
	case 13:
		sMaxAnswer = "ESFJ";
		break;
	case 14:
		sMaxAnswer = "INFJ";
		break;
	case 15:
		sMaxAnswer = "ENFJ";
		break;

	}
	sURL = sMaxAnswer + ".htm";
	window.open(sURL);
}

function mark(fm) {
	if (isAllAnswered(fm)) {

		goanstr()
	} else {
		alert("对不起，您没有回答全部，请认真回答！")
	}
}